package cn.com.blueInfo.bpm.template.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 动作类型
 * @author suxch
 * @since 2025/8/28 22:40
 */
@Getter
@AllArgsConstructor
public enum EventActionType implements BaseEnum<String> {

    /** 动作类型-跳转节点 */
    NODE_JUMP("NODE_JUMP", "跳转节点"),
    /** 动作类型-发送通知 */
    SEND_NOTIFY("SEND_NOTIFY", "发送通知"),
    /** 动作类型-自动审批 */
    AUTO_APPROVE("AUTO_APPROVE", "自动审批");

    @EnumValue
    private final String code;

    @JsonValue
    private final String desc;

    public static EventActionType getByCode(String code) {
        return BaseEnum.getByCode(EventActionType.class, code);
    }

    @JsonCreator
    public static EventActionType getByName(String name) {
        return BaseEnum.getByName(name, EventActionType.class);
    }

}
